<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<title>
			<fmt:message key="info_location_${param.location }"></fmt:message>
		</title>
		<script type="text/javascript" src="${ctx }/scripts/plugins/date/timer.js"></script>
		<script type="text/javascript" src="${ctx }/scripts/plugins/area/areaData.js"></script>
		<script type="text/javascript" src="${ctx }/scripts/plugins/area/areaSelector.js"></script>
		
		<script type="text/javascript" src="${ctx }/scripts/rollbook/userinfo/userinfo.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$("#locationForm").validationEngine();
			});
		</script>
	</head>
	<body>
		<div class="container_16">
			<div class="grid_3">
				<jsp:include page="/common/menu_2.jsp"/>
			</div>
			<div class="grid_10 alpha omega">
				<div class="content_top">
					<div class="left">
						<img src="${ctx }/images/<fmt:message key='img_location_${param.location }'></fmt:message>" />
					</div>
					<div class="right">
						<h7>${currentRole.roleType.id eq 4 ? "企业" : "个人" }设置 > <fmt:message key="info_location_${param.location }"></fmt:message><h7/>
					</div>
					<div id="divTime" class="time">
				        <label id="lblDate"></label>
				        <label id="lblTime"></label>
				     </div>
				</div>
				<div class="content_bottom">
					<div class="reg_middle reg">
						<p></p>
						<p></p>
						<c:choose>
							<c:when test="${param.location eq 'office'}">
								<table cellpadding="0" cellspacing="0">
									<tr>
										<td>
											<img src="${ctx }/images/at_office.png" />
										</td>
										<td>
											<div class="des">
												请确认您当前是在使用办公室的电脑上网，并且跟住处使用的不是一台电脑。设置成功后，如果您因为任何原因清除了浏览器Cookie，都需要重新设置，否则系统不能自动记录。
											</div>
										</td>
									</tr>
								</table>
							</c:when>
							<c:otherwise>
								<table cellpadding="0" cellspacing="0">
									<tr>
										<td>
											<img src="${ctx }/images/at_home.png" />
										</td>
										<td>
											<div class="des">
												请确认您当前是在使用住处的电脑上网，并且跟办公室使用的不是一台电脑。设置成功后，如果您因为任何原因清除了浏览器Cookie，都需要重新设置，否则系统不能自动记录。
											</div>
										</td>
									</tr>
								</table>
							</c:otherwise>
						</c:choose>
						<form id="locationForm">
							<input type="hidden" id="id" name="id" value="${currentUser.id }" />
							<input type="hidden" id="location" name="location" value="${param.location }" />
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td>
										<label>所在地区：</label>
									</td>
									<td>
										<select id="province" name="userInfo.province" class="validate[required] input_100"></select>
									    <select id="city" name="userInfo.city" class="validate[required] input_100"></select>
									    <select id="county" name="userInfo.county" class="validate[required] input_100"></select>
									</td>	
								</tr>
								<tr>
									<td>
										<label>详细地址：</label>
									</td>
									<td>
										<input id="address" name="userInfo.address" class="validate[required] input" type="text" style="width: 300px;"/>
									</td>	
								</tr>
								<tr>
									<td>
										&nbsp;
									</td>
									<td>
										<label class="btn"><input type="button" value="保存" onclick="saveLocation()" /></label>
										<label class="btn" style="margin-left: 10px;"><input type="reset" value="重置" /></label>
									</td>	
								</tr>
							</table>
						</form>
						<p></p>
						<p></p>	
						<p></p>
					</div>	
				</div>
			</div>
			<jsp:include page="../sitecontent/appInfo.jsp"></jsp:include>
		</div>
		<div class="container_16" style="margin-top: 50px;">
			<p></p>
		</div>
		
		<script type="text/javascript">			
			initArea("province","","city","","county","");
	<%--		$("#province").val("${currentUser.userInfo.province }");--%>
	<%--		$("#city").val("${currentUser.userInfo.city }");--%>
	<%--		$("#county").val("${currentUser.userInfo.county }");--%>
	<%--		$("#city").append("<option value='' selected='selected'>${currentUser.userInfo.city }</option>");--%>
		</script>
	</body>
</html>